#include "GameModel.h"
using namespace std;

void GameModel::startGame(GameType type)
{
    gameType=type;

    //初始化棋盘
    gameMapVec.clear();
    for(int i=0;i<board_size;i++)
    {
        vector<int> lineboard;
        for(int j=0;j<board_size;j++){
            lineboard.push_back(0);
        }
        gameMapVec.push_back(lineboard);
    }

    //轮到黑棋
    playerflag=true;
}

void GameModel::actionPerson(int row,int col)
{
    updateGameMap(row,col);
}

void GameModel::updateGameMap(int row,int col)
{
    if(playerflag)
        gameMapVec[row][col]=1;
    else
        gameMapVec[row][col]=-1;

    //换手
    playerflag=!playerflag;
}
